import logging
import utils

from google.appengine.api import users

class AppUser:
	def get(self, dispatcher):
		logging.info("get")
		currentUser = users.get_current_user()
		myDict = dict()
		myDict['logoutUrl']= users.create_logout_url("/")
		myDict['userName']= users.get_current_user().nickname()
		myDict['email']= users.get_current_user().email()
		myDict['isAdmin']=  users.is_current_user_admin()
		return myDict

	def encode(self, decodeType, outputObj, dispatcher):
		return utils.GqlEncoder().encode(outputObj)
